package net.wanho.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.RequiredArgsConstructor;
import net.wanho.dto.LoginDTO;
import net.wanho.exception.CaptchaException;
import net.wanho.service.CaptchaService;
import net.wanho.service.LoginService;
import net.wanho.vo.AjaxResult;
import net.wanho.vo.LoginUserVo;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Author：汤小洋
 * Date：2023-08-24 16:34
 * Description：<描述>
 */
@Api(tags = "02.登录接口")
@RestController
@RequiredArgsConstructor
public class LoginController {

    private final LoginService loginService;

    @ApiOperation("登录")
    @PostMapping("/login")
    public AjaxResult login(@RequestBody @ApiParam("登录用户信息") LoginDTO loginDTO){
        LoginUserVo loginUserVo = loginService.login(loginDTO);
        return AjaxResult.success(loginUserVo);
    }

}
